package io.renren.modules.oatools.utils.http.temp;

import io.renren.modules.oatools.utils.http.HttpRequestSend;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;


public class HttpTest {
    public static void main(String[] args) {

        // 准备请求体
        Map<String, Object> body = new HashMap<>();
//        body.put("violationID", violationID);
//        log.info("请求体内容：" + JSONUtil.toJSONString(body));
        // 发送HTTP请求
//        HttpRequestSend httpRequestSend = new HttpRequestSend();
//        httpRequestSend.setRequestUrl("http://10.130.160.152:7512/api/Violation/ViolationInfoRegister");
//        httpRequestSend.setRequestType("POST");
//        // 发送请求并处理响应
//        Map<String, Object> response = OAHttpRequestUtils.requestSend(JSON.toJSONString(body), httpRequestSend);


        HttpRequestSend httpRequestSend = new HttpRequestSend();
        httpRequestSend.setRequestUrl("http://localhost:8080/renren-admin/oatools/system/page?order=&orderField=&page=1&limit=10");
//        httpRequestSend.setRequestBody(null);
//        httpRequestSend.setRequestParams("{}");
        httpRequestSend.setRequestType("GET");
        httpRequestSend.setRequestHeaders("{\"token\":\"6f0e63036af48f2417a327ff108d79b4\"}");
//        httpRequestSend.setRequestBody("{}");
//        httpRequestSend.setIsAsyn(0);
//        httpRequestSend.setParamsGroovy("");
        try {
            System.out.println(OAHttpRequestUtils001.requestSend(null,httpRequestSend));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }    }
}